﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace HCQ2_Model.APPModel.ParamModel
{
    /// <summary>
    ///  上传接口模型
    /// </summary>
    public class UploadVRFileModel:BaseAPI
    {
        /// <summary>
        ///  商品编号
        /// </summary>
        public int fileOrder { get; set; }
        /// <summary>
        ///  是否参与批量购买
        /// </summary>
        public bool is_batch { get; set; }
        /// <summary>
        ///  是否主商品
        /// </summary>
        public bool is_main { get; set; }
        /// <summary>
        ///  商铺id
        /// </summary>
        //[RegularExpression("^([1-9][0-9]*)$",ErrorMessage = "商铺id必须项！")]//大于1正则表达式
        public int store_id { get; set; }
        /// <summary>
        ///  是否推荐【商铺-商品】
        /// </summary>
        public bool store_top { get; set; }
        /// <summary>
        ///  是否实物
        /// </summary>
        public bool is_entity { get; set; }
        public string out_link { get; set; }
        /// <summary>
        ///  完成课件时长 单位：分钟
        /// </summary>
        public int finish_time { get; set; } = 0;
        /// <summary>
        ///  商品来源
        ///  0：个人
        ///  1：自营
        /// </summary>
        public int supplyType { get; set; } = 0;
        /// <summary>
        ///  商品类型
        /// </summary>
        //[Required(ErrorMessage = "商品类型 必填项")]
        public string good_type { get; set; }
        /// <summary>
        ///  单价
        /// </summary>
        public decimal file_money { get; set; } = 0;
        /// <summary>
        ///  素材格式
        /// </summary>
        public string mater_type { get; set; }
        /// <summary>
        ///  月份、金额
        /// </summary>
        public List<FilePriceModel> listPrice { get; set; }
        /// <summary>
        ///  课件代码
        /// </summary>
        public string file_code { get; set; } = HCQ2_Common.Helper.GetGuid;
        /// <summary>
        ///  编号
        /// </summary>
        public string folder_num { get; set; }
        /// <summary>
        ///  素材/作品 名称
        /// </summary>
        [Required(ErrorMessage = "素材/作品 名称必填项")]
        public string file_name { get; set; }
        /// <summary>
        ///  产品类别
        ///  VRPPT=1；创客=2；头记=3；校史馆=4；
        /// </summary>
        [Required(ErrorMessage = "产品类别 必填项")]
        public int pro_type { get; set; } = 1;
        /// <summary>
        ///  是否允许编辑
        ///  0：不允许
        ///  1：允许
        /// </summary>
        public int allow_edit { get; set; } = 0;
        /// <summary>
        ///  别名
        /// </summary>
        public string alias_name { get; set; }
        /// <summary>
        ///  作者
        /// </summary>
        public string folder_author { get; set; }
        /// <summary>
        ///  联系电话
        /// </summary>
        public string folder_phone { get; set; }
        /// <summary>
        ///  发布时间
        /// </summary>
        public string issue_start { get; set; }
        /// <summary>
        ///  适合分类
        /// </summary>
        //[Required(ErrorMessage = "适合分类必填项")]
        public string file_classify { get; set; }
        /// <summary>
        ///  素材/作品 来源
        /// </summary>
        public string folder_source { get; set; }        
        /// <summary>
        ///  权限
        /// </summary>
        public string folder_limit { get; set; }
        /// <summary>
        ///  供应商
        /// </summary>
        public string supplier { get; set; }
        /// <summary>
        ///  素材/作品 属性
        ///  私有：0
        ///  公开：1
        /// </summary>
        [Required(ErrorMessage = "属性必填项")]
        public int file_status { get; set; }
        /// <summary>
        ///  文号
        /// </summary>
        public string doc_number { get; set; }
        /// <summary>
        ///  素材格式id
        /// </summary>
        public int folder_id { get; set; } = 0;
        /// <summary>
        ///  备注
        /// </summary>
        public string file_note { get; set; }
        /// <summary>
        ///  宣传地址
        /// </summary>
        public string spread_url { get; set; }
        /// <summary>
        ///  所属单位
        /// </summary>
        public string org_unit { get; set; }
        /// <summary>
        ///  附件集合
        /// </summary>
        public List<DocFileOption> option_file { get; set; } 
    }
    /// <summary>
    ///  编辑上传接口模型
    /// </summary>
    public class ModifyVRFileModel: BaseAPI
    {
        /// <summary>
        ///  商品编号
        /// </summary>
        public int fileOrder { get; set; }
        /// <summary>
        ///  是否参与批量购买
        /// </summary>
        public bool is_batch { get; set; }
        /// <summary>
        ///  楼层数
        /// </summary>
        public string doc_number { get; set; }
        /// <summary>
        ///  商铺id
        /// </summary>
        [RegularExpression("^([1-9][0-9]*)$", ErrorMessage = "商铺id必须项！")]//大于1正则表达式
        public int store_id { get; set; }
        /// <summary>
        ///  是否推荐【商铺-商品】
        /// </summary>
        public bool store_top { get; set; }
        /// <summary>
        ///  单位代码
        /// </summary>
        public string unit_code { get; set; }
        /// <summary>
        ///  外链
        /// </summary>
        public string out_link { get; set; }
        /// <summary>
        ///  作品来源
        /// </summary>
        public int supply_type { get; set; }
        /// <summary>
        ///  是否推荐
        /// </summary>
        public bool is_recommend { get; set; }
        /// <summary>
        ///  审批意见
        /// </summary>
        public string Opinion { get; set; }
        /// <summary>
        ///  作品状态
        ///  0：私有
        ///  1：待审核
        ///  4：已下架
        ///  5：已上架
        ///  6：审核未通过
        /// </summary>
        public int file_status { get; set; } = 5;
        /// <summary>
        ///  课件 作品/素材ID
        /// </summary>
        [Required(ErrorMessage = "file_id：必填项！")]
        public int file_id { get; set; }
        /// <summary>
        ///  目录导航id
        /// </summary>
        public int folder_id { get; set; }
        /// <summary>
        ///  产品形态 
        ///  VR=1；虚拟仿真=2；AR=3；
        /// </summary>
        public int pro_form { get; set; } = 1;
        /// <summary>
        ///  是否允许编辑 
        ///  0：不允许，1：允许
        /// </summary>
        public bool allow_edit { get; set; } = false;
        /// <summary>
        ///  适合分类
        /// </summary>
        //[Required(ErrorMessage = "适合分类必填项")]
        public string file_classify { get; set; }
        /// <summary>
        ///  素材/作品 名称
        /// </summary>
        [Required(ErrorMessage = "素材/作品 名称必填项")]
        public string file_name { get; set; }
        /// <summary>
        ///  产品类别
        ///  VRPPT=1；创客=2；头记=3；校史馆=4；
        /// </summary>
        [Required(ErrorMessage = "产品类别 必填项")]
        public int pro_type { get; set; } = 1;
        /// <summary>
        ///  素材/作品 代码
        /// </summary>
        [Required(ErrorMessage = "素材/作品 代码必填项")]
        public string file_code { get; set; }
        /// <summary>
        ///  别名
        /// </summary>
        public string alias_name { get; set; }
        /// <summary>
        ///  备注、简介
        /// </summary>
        public string file_note { get; set; }
        /// <summary>
        ///  权限
        /// </summary>
        public string folder_limit { get; set; }
        /// <summary>
        ///  素材格式
        /// </summary>
        public string mater_type { get; set; }
        /// <summary>
        ///  月份、金额
        /// </summary>
        public List<FilePriceModel> listPrice { get; set; }

        /// <summary>
        /// 是否实物商品
        /// </summary>
        public bool isEntity { get; set; }
    }
    /// <summary>
    ///  附件属性模型
    /// </summary>
    public class DocFileOption
    {
        /// <summary>
        ///  宣传地址
        /// </summary>
        public string spread_url { get; set; }
        /// <summary>
        ///  附件服务器id
        /// </summary>
        public int service_id { get; set; }
        /// <summary>
        ///  素材后缀
        /// </summary>
        public string file_suffix { get; set; }
        /// <summary>
        ///  素材/作品ID
        /// </summary>
        public int file_id { get; set; }
        /// <summary>
        ///  头显设备：下拉
        /// </summary>
        public string head_facility { get; set; }
        /// <summary>
        ///  定价：私有时不需要设置价格
        /// </summary>
        //[Required(ErrorMessage = "定价必填项")]
        public decimal file_money { get; set; } = 0;
        /// <summary>
        ///  名称
        /// </summary>
        public string option_name { get; set; }
        /// <summary>
        ///  文件类型
        /// </summary>
        public string option_type { get; set; }
        /// <summary>
        ///  大小
        /// </summary>
        public decimal option_size { get; set; }
        /// <summary>
        ///  文件附件存放路径
        /// </summary>
        public string option_url { get; set; }
        /// <summary>
        ///  适用平台 
        /// </summary>
        public string option_plat { get; set; }
        /// <summary>
        ///  备注
        /// </summary>
        public string option_note { get; set; }
    }
    public class FilesModel: BaseAPI
    {
        /// <summary>
        ///  文件id
        /// </summary>
        public int file_id { get; set; }
        /// <summary>
        ///  作品代码
        /// </summary>
        public string file_code { get; set; }
    }
    public class OptionFilesModel : BaseAPI
    {
        /// <summary>
        ///  附件id
        /// </summary>
        public int option_id { get; set; }
    }
    public class BagFileRecordModel: BaseAPI
    {
        /// <summary>
        ///  缩略图id
        /// </summary>
        public int bag_id { get; set; }
        /// <summary>
        ///  作品id
        /// </summary>
        public int file_id { get; set; }
    }
    public class AddVRSingleFileOption: BaseAPI
    {
        /// <summary>
        ///  素材/作品ID
        /// </summary>
        public int file_id { get; set; }
        /// <summary>
        ///  名称
        /// </summary>
        public string option_name { get; set; }
        /// <summary>
        ///  文件类型
        /// </summary>
        public string option_type { get; set; } = "";
        /// <summary>
        ///  大小
        /// </summary>
        public decimal option_size { get; set; }
        /// <summary>
        ///  文件附件存放路径
        /// </summary>
        public string option_url { get; set; }
        /// <summary>
        ///  ios文件存放路径 
        /// </summary>
        public string option_plat { get; set; }
        /// <summary>
        ///  头显设备 
        /// </summary>
        public string head_facility { get; set; }
        /// <summary>
        ///  定价
        /// </summary>
        public decimal file_money { get; set; } = 0;
        /// <summary>
        ///  备注
        /// </summary>
        public string option_note { get; set; }
    }
    public class FilePriceModel
    {
        /// <summary>
        ///  月份
        /// </summary>
        public int op_month { get; set; }
        /// <summary>
        ///  原价金额
        /// </summary>
        [Range(0, 9999, ErrorMessage = "金额规定范围需在0~9999")]
        public decimal ori_price { get; set; } = 0;
        /// <summary>
        ///  名称
        /// </summary>
        public string price_name { get; set; }
    }
}